Repository navigation
Simplify AddMicrosoftIdentityMessageHandler configuration overload - #4124
Merged
Bogdan Gavril (bgavrilMS) merged 2 commits intoOct 30, 2026
Merged
Bogdan Gavril (bgavrilMS) merged 2 commits into
Bogdan Gavril (bgavrilMS) merged 2 commits into
Conversation
Copilot CLI created this pull request from a session on behalf of
Jean-Marc Prieur (jmprieur)
October 29, 2026 04:10
Jean-Marc Prieur (jmprieur)
marked this pull request as ready for review
October 30, 2026 01:00
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The deferred-binding behavior lacks a regression test for configuration changes after registration across both overloads.
1 open issue
What changed in this PR
Simplifies configuration-based HTTP message handler registration in Microsoft Identity Web by accepting a configuration section without a redundant section name, addressing #4123.
Changes:
- Adds a configuration-only overload while preserving the existing overload’s null checks and deferred binding.
- Updates public API records, documentation examples, and the development sample.
- Expands regression coverage for both overloads, including per-client options, null arguments, empty configuration, and builder chaining.
| File | Description |
|---|---|
| tests/Microsoft.Identity.Web.Test/MicrosoftIdentityHttpClientBuilderExtensionsTests.cs | Tests both overloads and verifies bound options for separate clients. |
| tests/DevApps/MtlsPop/MtlsPopClient/Program.cs | Adopts the simplified overload. |
| src/Microsoft.Identity.Web.TokenAcquisition/PublicAPI/NetFramework/PublicAPI.Unshipped.txt | Records the new .NET Framework API signature. |
| src/Microsoft.Identity.Web.TokenAcquisition/PublicAPI/NetCore/PublicAPI.Unshipped.txt | Records the new .NET Core API signature. |
| src/Microsoft.Identity.Web.TokenAcquisition/MicrosoftIdentityHttpClientBuilderExtensions.cs | Adds the overload and clarifies the legacy parameter’s behavior. |
| docs/calling-downstream-apis/token-binding.md | Simplifies the configuration example. |
| docs/calling-downstream-apis/custom-apis.md | Updates downstream API examples to omit redundant section names. |
Review effort: Balanced
Member
Bogdan Gavril (bgavrilMS)
approved these changes
Oct 30, 2026
Add a configuration-only overload while preserving the existing signature and validation. Update examples and verify bound options for both overloads. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bogdan Gavril (bgavrilMS)
force-pushed
the
copilot/fix-4123-message-handler-configuration
branch
from
October 30, 2026 11:44
5516aec to
15e144c
Compare
Bogdan Gavril (bgavrilMS)
enabled auto-merge (squash)
October 30, 2026 11:45
Bogdan Gavril (bgavrilMS)
deleted the
copilot/fix-4123-message-handler-configuration
branch
October 30, 2026 12:02
Bogdan Gavril (bgavrilMS)
added a commit
that referenced
this pull request
Oct 30, 2026
Preserve the configuration-only overload and regression tests merged in #4124. Retain only warning-level deprecation, migration documentation, and scoped legacy-test suppressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7c2c7e51-63ee-4823-9636-693c8bab1a13
4 tasks done
This was referenced Nov 5, 2026
Closed
Merged
Merged
This was referenced Nov 24, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Simplify AddMicrosoftIdentityMessageHandler configuration overload
Configure the message handler without repeating the configuration section name.
Description
Callers can now pass a configuration section directly:
The existing overload remains supported with the same null checks and behavior. Its documentation now makes clear that
sectionNameis otherwise unused. The new overload reuses the existing delegate-based registration and still binds configuration when the handler is created.Updated the public API records, documentation examples, and development sample. Regression coverage checks both overloads, including bound scopes and app-token settings for separate clients, null arguments, empty configuration, and builder chaining.
Validation: 42 focused tests passed on .NET 10; the TokenAcquisition netstandard2.0 build succeeded with no warnings or errors. The configured package feed failed during restore, so validation used NuGet.org without changing repository configuration.
Fixes #4123